﻿using System;
using System.Collections.Generic;

namespace Model
{
    public class Equipment: BaseModel
    {

        private EquipmentModel _ModelEquipement;
        
         public EquipmentModel ModelEquipement
        {
            get { return _ModelEquipement; }
            set { _ModelEquipement = value; }
        }

        public virtual EquipPurchaseInfo PurchaseInfoEquip { get; set; }
        
        public virtual int EquipmentId {get; set;}

        public virtual int ModelId { get; set; }

        public virtual string HardwareDescription { get; set; }

        public virtual int PurchaseId { get; set; }

        public virtual bool IsDamaged { get; set; }

        public virtual string SerialNumber{ get; set; }
        public virtual string CodeNumber { get; set; }

        public virtual DateTime EstimatedEOL { get; set; }

        public virtual string DemageDEsc { get; set; }
        public virtual IList<EquipmentOwner>  EquipmentOwnerList { get; set; }
        
         //foreign key
        public   string ModelLabel
        {
            get
            {
                return _ModelEquipement.ModelLabel;
            }
        }
      
        public string PurchaseCompany
        {
            get
            {
                return PurchaseInfoEquip.Supplier.SupplierName;
            }
        }
        public DateTime PurchaseDate
        {
            get
            {
                return DateTime.Parse(PurchaseInfoEquip.PurchaseDate.ToString("MM/dd/yyyy"));
            }
        }
       

       
        public override int Key
        {
            get { return this.EquipmentId; }
        }
       
    }
}
